package encomendaFacil.dao;

public class DAOFactory {

	private static final DAOFactory INSTANCE = new DAOFactory();
	
	private UserDAO userDAO;
	private PackageDAO packageDAO;
	
	private DAOFactory() {}
	
	public static DAOFactory getInstance(){
		if (INSTANCE == null) {
			return new DAOFactory();
		}
		return INSTANCE;
	}

	public UserDAO getUserDAO() {
		if (userDAO == null) {
			return new UserDAO();
		}
		return userDAO;
	}

	public PackageDAO getPackageDAO() {
		if (packageDAO == null) {
			return new PackageDAO();
		}
		return packageDAO;
	}
}
